<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 使用new Object()方式创建一个对象，准备描述班长
      var banzhang = new Object();

      // 添加一些属性例如姓名、性别、iq（用到点操作符和中括号操作符）
      banzhang.name = "杰哥";
      banzhang["iq"] = 250;
      console.log(banzhang);

      // 删除一些属性，例如iq；
    //   delete banzhang.iq;
      delete banzhang["iq"];
      console.log(banzhang);

      // 修改一个属性，例如性别；
      banzhang.name = "BroJie";
      banzhang["name"] = "第四野战军军长";
      console.log(banzhang);

      banzhang.age = 18
      banzhang.gender = true
      banzhang["gf"] = {name:"党哥",age:50}
      // 查询一下各个属性的值（用到点操作符和中括号操作符）；
      for(var attr in banzhang){
        //   console.log(key,typeof(key));
          console.log(attr,banzhang[attr]);
      }

      
    </script>
  </body>
</html>
